home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
FILLLOAD.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
4KB
|
82 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME FILLLOAD.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
COLOR 7,0
CLS
? "┌────────────────────────────────────────────────────────────────────
? "│ QFillBarr, QFillIarr, QFillLarr QFillBptr, QFillIptr, QFillLptr
? "│ Many times I have found it necessary to fill an array or chunk of memory
? "│ with a particular value (usually 0). If you know the array's handle and
? "│ ZERO is the value you seek then REDIM works just fine, but there are times
? "│ when the whole array can't be zeroed, the routine is working with pointers
? "│ and/or zero is not the required value. The biggest differences in these 6
? "│ subs is that: 3 work on numeric variables, 3 work on far pointers and
? "│ there are 1byte, 2byte and 4byte versions of each.
? "│ Of the 3 calls to QFillXArr, below, the first and last are good examples
? "│ of what <<NOT>> to do unless you want permanently grey hair!
? "├────────────────────────────────────────────────────────────────────────────
? "│ QLoadBarr, QLoadIarr QLoadBptr, QLoadIptr
? "│ These four are kissin' cousins to the ones above and work just a bit
? "│ differently in that they increment the incoming value so each element
? "│ is 1 greater than the previous element.
? "└────────────────────────────────────────────────────────────────────────────
DIM I%(99)
QFillBarr I%(0), 1, 200
PRINT "CALL QfillBarr( I%(0), 1, 200 ) :";
FOR X% = 0 TO 3
PRINT USING " I%(#)=###"; X%, I%(X%);
NEXT
PRINT
QFillIarr I%(0), 1, 100
PRINT "CALL QfillIarr( I%(0), 1, 100 ) :";
FOR X% = 0 TO 3
PRINT USING " I%(#)=###"; X%, I%(X%);
NEXT
PRINT
QFillLarr I%(0), 1, 50
PRINT "CALL QfillLarr( I%(0), 1, 50 ) :";
FOR X% = 0 TO 3
PRINT USING " I%(#)=###"; X%, I%(X%);
NEXT
PRINT
PRINT
B$ = SPACE$(26) : Bptr??? = STRPTR32( B$ )
QLoadBarr BYVAL Bptr???, 65, 26
PRINT "B$ = SPACE$(26)
PRINT "Bptr??? = STRPTR32( B$ )"
PRINT "CALL QLoadBarr(BYVAL Bptr???,65,26) : B$="; B$
DIM I??(100)
DIM I_ptr AS WORD PTR
I_ptr = VARPTR32( I??(0) )
QLoadIarr BYVAL I_ptr, 0, 100
PRINT "CALL QLoadIarr(I??(0), 0,100) : ";
FOR X% = 0 TO 3
PRINT USING " I??(#)=##"; X%, I??(X%);
NEXT